import request from '@/utils/request'

const manage = {
  getTableByUnitId(unitId, years) {
    return request.get(`/kjtjdc/tableUnit/getByUnitIdAndYear/${unitId}/${years}`)
  },
  addTablesForUnit(data) {
    return request.post('/kjtjdc/tableUnit/addTables', data)
  },
  addTableForUnits(data) {
    return request.post('/kjtjdc/tableUnit/addUnits', data)
  },
  getTableInfo(id) {
    return request.get(`/kjtjdc/tableInfo/detail/${id}`)
  },
  getStatisticsByTable(params) {
    return request.get(`/kjtjdc/tableInfo/tableFill`, {
      params: {
        years: params.years,
        pageSize: params.pageSize,
        pageNum: params.pageNum
      }
    })
  },
  getDeptTreeByTableFill(params) {
    return request.get('/kjtjdc/tableUnit/getDeptList', {
      params: {
        years: params.years,
        tableId: params.tableId,
        fill: params.fill
      }
    })
  }
}

export default manage